<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click.once="printMsg()">一次性修饰符</button>
        <hr>
        <p>{{msg}}</p>
        <textarea cols="20" rows="10" @input="msg=$event.target.value"></textarea>
        <textarea cols="20" rows="10" @keyup="getInput($event.target.value)"></textarea>
        <textarea cols="20" rows="10" @keyup="getIt($event)"></textarea>
        <textarea cols="20" rows="10" @keyup.Enter="getInput($event.target.value)"></textarea>
        <textarea cols="20" rows="10" @keyup.13="getInput($event.target.value)"></textarea>
        <hr>
        <textarea cols="20" rows="10" @keyup.ctrl.c="msg=$event.target.value"></textarea>
        <textarea cols="20" rows="10" @keyup.ctrl.c="copyFun($event.target.value)"></textarea>
        <textarea cols="20" rows="10" @keyup.a.c="copyFun($event.target.value)"></textarea>

    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                msg:""
            },
            methods:{
                printMsg(){
                    console.log("printMsg");
                },
                getInput(e){
                    this.msg=e;
                },
                getIt(e){
                    console.log(e);
                },
                copyFun(e){
                    console.log(e);
                }
            }
        })
    </script>
</body>
</html>